home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
01
/
6
/
DISK0162.ZIP
/
ED.DOC
< prev
next >
Wrap
Text File
|
1984-10-10
|
27KB
|
901 lines
October 1984
This document tells how to use the text editor program, ED.EXE,
so that you can enter and maintain your Structured BASIC programs
This manual assumes you are familiar with MS DOS and Microsoft
BASIC.
THE BASIC NECESSITIES THE BASIC NECESSITIES
EDITOR USER'S MANUAL EDITOR USER'S MANUAL
Manual version: 1.12
Software version: 1.12
Marty Franz
525 W. Walnut St., Kalamazoo, MI 49007
(616) 344-1821
(C) Copyright 1983 Marty Franz - All rights reserved
100784112 Editor User's Manual
INTRODUCTION INTRODUCTION
ED.EXE is a text editor specially designed for the entry and
editing of Structured BASIC programs.
Briefly, ED lets you easily enter and modify your Structured
BASIC programs without resorting to EDLIN. ED is screen-
oriented, so you can edit 24 lines of text at once, and uses the
IBM PC's special keys for many of its editing functions.
Right now, ED is an in-memory editor. This means that files
must be transferred to and from a buffer in memory for editing.
Only files small enough to fit entirely in memory (up to 60KB
maximum) can be edited using ED.
In actual use, ED works a lot like BASIC does: you LOAD
programs into ED's memory buffer, edit them, then SAVE them back
to diskette when you're done. After a program has been stored on
diskette, it can be translated by the Structured BASIC
preprocessor into a runnable BASIC program.
Please take the time to read these instructions before you
use ED. The best way to learn ED is to practice editing a file,
trying out each command, editing function, or special key until
you feel comfortable with it. ED's SAVE and RESAVE commands make
it unlikely that you will destroy valuable data.
PROGRAM REQUIREMENTS PROGRAM REQUIREMENTS
To edit files using ED, you need an IBM PC, XT, or jr with:
- at least 64KB of memory, (if you have this much memory
your file size will be limited to about 15KB)
- at least one single-sided diskette drive,
- a color or monochrome adapter, with a monitor capable
of displaying 80-character lines,
- MS DOS version 1.1 or 2.x, and
- the file ED.EXE.
BUGS AND IDEAS BUGS AND IDEAS
When you are using ED, please remember that this is only
version 1.12. If you find bugs, or you have ideas for improving
this editor, please contact me:
Marty Franz
525 W. Walnut St.
Kalamazoo, MI 49007
(616) 344-2043
Page 2 100784112 Editor User's Manual
BASIC MODES BASIC MODES
When you are editing with ED, the editor is always in one of
three modes, called edit, insert, and command. Each mode is
adapted to a particular set of editing tasks. Insert mode is
used when a lot of text is being added to the file. Edit mode is
used for touring the file and making minor changes to many lines.
Command mode is used with longer, BASIC-like commands that affect
the overall structure of the file and possibly even delete parts
of it.
ED uses the 25th line of your screen as a status line to
display the current mode, and other important facts such as the
name of the file being edited. The status line is always
displayed in reverse video, and tells:
- the mode (command, edit, or insert),
- the name of the file being edited,
- the line in the file the cursor is on,
- the column on the screen the cursor is on.
The remainder of the screen, lines 1-24, is called the "edit
area" in this manual and is used to display the actual text lines
of the file you are working on. Only 80 characters in a line can
be displayed at any one time, even though ED can edit lines of
up to 255 characters in length.
To start ED from MS DOS, enter:
A>ed
ED will clear the screen, display the status line at the bottom,
and begin your editing session.
Page 3 100784112 Editor User's Manual
COMMAND MODE COMMAND MODE
ED begins the edit session in command mode. At this point
the memory buffer is empty. You must use the LOAD command to
load a file into memory for editing, or enter insert mode and
input new text lines into the buffer. The LOAD command is
described later in this section.
Once editing is underway, you may freely switch between the
three modes mentioned earlier. The functions available in each
mode are described in one of the next three sections of this
manual. The individual command mode commands are described below
in this section. When you read their descriptions, remember that
the squiggly braces { and } are placed around items which you
must supply as "arguments" to a command. Also note that whenever
a line number is mentioned, it refers to a line number in the
file, not a BASIC line number.
APPEND APPEND
The APPEND command has the format:
APPEND {d:filename.ext}
APPEND loads the file {d:filename.ext} into the buffer at the
line just ahead of the current line. The name of the file being
edited remains the same.
CHANGE CHANGE
CHANGE is used to search for a pattern in a range of text
lines and replace it with another. The format of the CHANGE
command is:
CHANGE {start line} {end line}
After this has been typed, ED prompts for the old pattern by
asking "from:" . The old pattern is then entered. Just pressing
the "enter" key cancels the command. After getting the old
pattern ED prompts "to:" for the new pattern. When this is
input the edit area clears and the changes made and their line
numbers are displayed. If you press any key on the keyboard
during this process the change is cancelled at that point. If
{startline} and {endline} are specified, the change occurs only
over that line range. If {endline} is omitted, the last line in
the file is assumed. If both {startline} and {endline} are
omitted, all the lines in the file are assumed.
Page 4 100784112 Editor User's Manual
Search Strings Search Strings
In specifying a pattern to search for, two special characters
may be used to make this process easier.
The first, {^}, (the shifted-6 character on your keyboard)
"anchors" the search to the start of the line in the file. That
is, only characters beginning in column 1 will be checked for the
pattern.
The second special character, {?}, is used as a "wild card",
a character that matches any at all in the text line.
Change Strings Change Strings
In specifying a new pattern for the CHANGE command, the {?}
(wild card) character may be used to match a corresponding
character in the old pattern. There must be as many {?}s in the
change string as there are in the search string.
DELETE DELETE
The DELETE command is used to delete a range of lines in the
buffer. It has the format:
DELETE {start line} {end line}
Here, {start line} and {end line} are used just as they are with
the CHANGE command. No check is made to see if the buffer has
been saved before the DELETE command is executed, so use this
command with care. After DELETE completes, command mode resumes
with the first line after those deleted shown at the top of the
edit area.
FIND FIND
The FIND command searches for a string in the file. When the
string is found, ED will enter edit mode and the line will be
displayed at the top of the edit area with the next 23 lines in
the file shown below it. The format of the FIND command is
simply:
FIND
If the string is not found, ED remains in command mode.
Page 5 100784112 Editor User's Manual
G (GOTO) G (GOTO)
The G command is used to go to a line in the file and enter
edit mode. The line is displayed at the top of the edit area,
with the next 23 lines in the file shown after it. G's format
is:
G {n}
Typing G with no line number is the same as pressing F1, the edit
mode key. Typing G * will take you to the end of the file.
HELP HELP
The HELP command displays a one-page summary of ED's commands
and function keys on the screen.
LOAD LOAD
LOAD will read a file from diskette into the memory buffer,
overlaying whatever text was there before. If what you were
editing wasn't saved, the "file not saved" message (see "NEW"
below) is displayed. The LOAD command's format is:
LOAD {d:filename.ext}
The LOAD command also sets the filename on the status line for
future SAVE and RESAVE commands.
LLIST LLIST
The LLIST command is used to list a range of lines in the
file on your printer. Its format is:
LLIST {start line} {end line}
The printer currently used by MS DOS as LPT1: will receive the
output. Both {start line} and {end line} work the way they do
for the CHANGE command. The listing produced will have the same
format as the one produced by the LLIST.EXE program.
LPAGE LPAGE
The LPAGE command is used to set the length of a page for the
LLIST command to use. Its format:
LPAGE {lines/page}
The {lines/page} can be whatever your printer will allow, with a
minimum of 5 lines/page required.
Page 6 100784112 Editor User's Manual
LWIDTH LWIDTH
The LWIDTH command is used to set the number of columns on a
print line for the LLIST command. If a line is longer than this
number of columns, it will wrap on the listing. The format for
LWIDTH is:
LWIDTH {columns/line}
The number of columns must be between 40 and 132.
NAME NAME
NAME is used to set the name of the file for the SAVE and
RESAVE commands. Normally, NAME isn`t used much because the name
of the file being edited is set by the LOAD command. The format
of NAME is:
NAME {d:filename.ext}
No disk access is done by NAME, only the filename displayed on
the status line is changed.
NEW NEW
NEW will clear the current buffer and the filename. Its
format is simply:
NEW
A check is made to see if the buffer has been saved before
proceeding. If not, the message:
file not saved. proceed?
is displayed. Answering {y} will cause ED to clear the buffer
and the edit area; Typing {n} will abort the command.
PREP PREP
The PREP command will exit ED and then invoke the Structured
BASIC preprocessor using the SB command. It will pass along the
name of the file being edited. The file's extension is assumed
to be .SB. PREP will check to determine if the buffer has been
saved before proceeding. If it hasn't, you'll be given a change
to save your file. The format for PREP is simply:
PREP
Page 7 100784112 Editor User's Manual
RESAVE RESAVE
RESAVE will save the file currently being edited back to
disk. It assumes the file already exists. The filename used It assumes the file already exists.
will be the one displayed on the status line. The format of
RESAVE is:
RESAVE
SAVE SAVE
SAVE saves the file in the buffer back to disk. Unlike
RESAVE, it assumes the file does not exist. If the file exists it assumes the file does not exist.
a warning message is displayed and nothing happens. The format
for SAVE is:
SAVE
SEARCH SEARCH
SEARCH will ask for a search string and will then display all
the occurences of the string in the file. The format of the
SEARCH command is simply:
SEARCH
SYSTEM SYSTEM
The SYSTEM command is used to exit ED and go back to MS DOS,
just like it is in Microsoft BASIC.
TABS TABS
The TABS command has the format:
TABS {n}
This command sets the column stops for the tab key to every {n}
columns. Setting TABS less than or equal to 0 is the same as
setting TABS to 1. When ED is started, 4 is the initial tab
setting.
Page 8 100784112 Editor User's Manual
EDIT MODE EDIT MODE
Edit mode is entered by pressing F1 at any time. Edit mode
is used for changing individual text lines and for touring the
file.
Edit mode operates normally as "edit: replace". This means
that the characters you type directly replace those under the
cursor. The PF, cursor arrow, PgUp, PgDn, Home, and End keys
allow you to tour the edit area and make changes. Pressing the
Ins key will let you insert text at any point in Insert mode. The
actions of all the special keys are described in the "ED KEY MAP"
section of this manual.
In addition, there are four extra editing functions available
in edit mode. These work on only the line the cursor is on and
are described here below. They are activated by pressing F1
within edit mode. When these functions are active, text cannot
be arbitrarily replaced and the mode is displayed as "edit:" on
the status line. To go back to "edit: replace" operation, press
F1 again in edit mode. The "setting" of edit mode is remembered
if you go into command or insert mode and will be the one you
resume edit mode with later.
EDIT: GOTO EDIT: GOTO
Typing G will cause ED to ask for a line number. When this is
supplied, this line is displayed at the top of the edit area and
edit mode resumes. This function works the same as G does in
command mode. You can type "*" to go to the end of the file.
EDIT: KILL EDIT: KILL
Typing K will cause ED to ask for a single character. After this
is received, all the characters from the cursor right up to this
character (or the end of the line if the character isn't found)
will be deleted.
EDIT: SEARCH EDIT: SEARCH
Typing S will cause ED to ask for a single character. When this
is entered, the cursor will move right to this character or the
end of the line.
EDIT: EXCHANGE EDIT: EXCHANGE
Typing X will cause ED to ask for a single character. This
character will then replace the one under the cursor. If you
have to replace a lot of text on a line you should press F1 and
use the "edit: replace" method mentioned earlier.
Page 9 100784112 Editor User's Manual
INSERT MODE INSERT MODE
Insert mode is used for rapid entry of text. You can enter
Insert mode at any time by pressing the Ins key on the PC. When
this is done "insert" is displayed on the status line and the
cursor fattens. Text can now be entered in the edit area at the
line the cursor is on. The characters you enter will will be
inserted to the left of the character the cursor was on when you
started.
In insert mode, only some of the special edit mode control
keys retain their normal function. These are summarized in the
"ED KEY MAP" section of the manual. More importantly, the ENTER
key will continue insert mode on the line below the cursor,
opening a new line in the edit area, and scrolling the lines
below down a line.
Insert mode is exited by pressing Ins again to enter edit
mode, or F1 (edit) or F2 (command).
Page 10 100784112 Editor User's Manual
ED KEY MAP ED KEY MAP
This section lists ED's special keys and what they do.
KEY DESCRIPTION ___ ___________
F1 Enters edit mode.
F2 Enters command mode.
F3 In edit mode, moves cursor up one line and enters
insert mode (insert up).
F4 In edit mode, moves cursor down one line and enters
insert mode (insert down).
F5 In edit mode, splits the line at the cursor.
F6 In edit mode, joins current line to end of line above
it. All lines below the cursor move up one in the
edit area.
F7 In edit mode, deletes entire line cursor is on. All
lines below move up one in edit area.
F8 Deletes from cursor through the end of the
current line.
F10 Undoes any changes made in edit mode to current
line.
Home In edit mode, moves cursor to start of current line.
End In edit mode, moves cursor to end of current line.
Up In edit mode, moves cursor up one line. Used in
Arrow insert mode, moves up a line and enters edit mode.
Down In edit mode, moves cursor down one line. Used in
Arrow insert mode, moves down a line and enters edit mode.
Left In edit mode, moves cursor left one character.
Arrow "Character" means a tab may move the cursor several
columns. Also works in insert mode. For lines
longer than 80 characters, the line itself will
scroll as needed.
Right In edit mode, moves cursor right one character. Also
Arrow works in insert mode. For lines greater than 80
characters, the line displayed will scroll as
needed.
Page 11 100784112 Editor User's Manual
KEY DESCRIPTION ___ ___________
PgUp In edit mode, starts scrolling the edit area forward
through the file (towards the front). Pressing any
key stops scrolling and resumes edit mode at the
cursor.
PgDn Same as PgUp, but scrolls down through the file.
Ins Insert mode toggle; enters insert mode, then enters
edit mode if used in insert mode.
Del Deletes character at cursor; line moves left one
character, cursor stays at same place. Works in both
insert and edit modes.
<- (Backspace) Deletes character to left of cursor;
cursor moves left one character. Works in both insert
and edit modes.
<-' (Enter) Has no effect in edit mode; in insert mode
moves cursor down one line and continues text
insertion.
Space In edit mode only, acts the same as the Left Arrow
Bar key, moving the cursor left one character.
Page 12 100784112 Editor User's Manual
ERROR MESSAGES ERROR MESSAGES
Here's a list of the error messages ED will give you when you
do something wrong. They will display on the status line after
the incorrect command. To continue editing when an error occurs,
press "enter" and the message will disappear.
If you ever receive a message prefaced by the words "error:",
"disk error:", or "system error:", SAVE your changes to a new
file immediately and then abandon your editing session! One of
these messages means ED has seriously malfunctioned. Report it
after gathering as much information as you can.
command not found
This message means you tried to use a command that wasn't one
of the ones listed earlier.
pattern not found
The search string you tried to find in the file isn't there.
bad line number
You used a line number in the GOTO command that isn't a
positive number. Only the digits 0-9 can be used when you
specify a line number.
no file argument
You tried to LOAD or APPEND a file without telling ED its
name.
file not found
The file you tried to LOAD or APPEND from, or RESAVE to, does
not exist on your diskette, or you misspelled its name.
line truncated
The result of a LOAD or CHANGE command was a line greater
than 255 characters. The line was chopped off on the right.
You cannot currently edit lines with more than 255 characters
in them.
Page 13 100784112 Editor User's Manual
file not named
You have tried to SAVE or RESAVE a file without giving ED a
name to use for it. The NAME command will do this for you.
file exists
The file name you gave the SAVE command already exists on
your diskette. You need the RESAVE command instead.
bad argument
You gave a command using two arguments, such as DELETE, one
or more that were not numbers.
file not saved. proceed?
You will receive this message whenever you use the LOAD or
NEW command and you have not saved what you were working on.
This is because these commands clear the memory buffer.
Answer {y} or {n} depending on what you want to do - {y} to
continue and destroy the buffer, or {n} to back out and
cancel the command. You don't need to press "enter" after
typing {y} or {n}.
new line too long
The line created in a CHANGE command by substituting the new
pattern for the old one is turned out to be greater than 255
characters long. The CHANGE command aborts at this point.
too many ?'s in change mask
You had more ?'s in your change string than you did in your
search string. See the description of the CHANGE command in
this manual for more information.
error writing file
You will receive this message when you try to SAVE or RESAVE
your file and there isn't enough room on the drive you chose.
Only part of the file has been saved. You must insert a
fresh diskette and try to save the file again.
Page 14 100784112 Editor User's Manual
KNOWN BUGS KNOWN BUGS
There are currently no known bugs in ED. This last version
took care of several. If you find any, please report them
immediately.
In the next release of ED, we hope to add functions to move
and copy lines of text. This is the most pressing shortcoming of
ED we know about. Other planned enhancements include mouse
support, directory information, and setting tabs, etc. through
the DOS environment facility available in versions 2.x and
above.
Page 15 100784112